<!DOCTYPE html>
<script type="text/javascript" src="../js/angular.min.js" ></script>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		
	</head>
	<body ng-app="myapp" ng-controller="myctrl">
			<table width="100%" border="1">
			<tr>
				<th>序号</th>
				<th>商品编号</th>
				<th>商品名 称</th>
				<th>价格</th>
				
			</tr>
			<tr ng-repeat="product in products">
					<th>{{$index+1}}</th>
					<th>{{product.id}}</th>
					<th>{{product.name}}</th>
					<th>{{product.price}}</th>
			</tr>
		</table>
		
		
		<script type="text/javascript">
			var myapp = angular.module("myapp" ,[]);
			//定义该模块下的控制器
			myapp.controller("myctrl",["$scope",function($scope){
				$scope.products=[
				{
					id:001,
					name:"手机",
					price:2000
				},
				{
					id:002,
					name:"苹果",
					price:2000
				},
				{
					id:003,
					name:"魅族",
					price:3000
				}
				
				
				]
			}])
			
		</script>
	</body>
</html>
